package main

import (
	"net/http"
	"gitee.com/Cookie_XiaoD/video_server/api/defs"
	"io"
	"encoding/json"
)

//发送错误应答
func sendErrorResponse(w http.ResponseWriter,response defs.ErrorResponse){
	w.WriteHeader(response.HttpSC)
	resp,_:=json.Marshal(response.Error)
	io.WriteString(w,string(resp))
}

//发送正常应答
func sendNormalResponse(w http.ResponseWriter,sc int,resp string){
	w.WriteHeader(sc)
	io.WriteString(w,resp)
}
